/********************************************************************
	created:	2010/07/13
	created:	13:7:2010   17:01
	filename: 	D:\Proj\gcstock\code\C++\GCStock\RawData\GCRawDataParse.h
	file path:	D:\Proj\gcstock\code\C++\GCStock\RawData
	file base:	GCRawDataParse
	file ext:	h
	author:		Greg Song
	
	purpose:	
*********************************************************************/
#ifndef _GC_RAWDATA_PARSE_H_
#define _GC_RAWDATA_PARSE_H_
#include "GCHeader.h"

namespace gcstock
{
    class GCParseElement
    {
    public:
        GCLPCHAR        key;
        GCLPCHAR        prefix;
        GCTYPE          type;
        GCINT           fixedLength;
        GCBOOL            bIsFixedLength;
        GCParseElement():key(NULL),prefix(NULL),type(0),fixedLength(0),bIsFixedLength(FALSE){}
        GCParseElement* clone()
        {
            GCParseElement* pTmp = new GCParseElement;
            pTmp->bIsFixedLength = bIsFixedLength;
            pTmp->fixedLength = fixedLength;
            pTmp->type = type;
            int len = GCSTRLEN(key);
            pTmp->key = new GCCHAR[len];
            memcpy(pTmp->key, key, len);
            
            len = GCSTRLEN(prefix);
            pTmp->prefix = new GCCHAR[len];
            memcpy(pTmp->prefix,prefix,len);
            
            return pTmp;
        }
    };
}


#endif // _GC_RAWDATA_PARSE_H_